<template>
  <div class="add-box">
    <h3>我是减法组件--{{infoNum}}</h3>

    <p>我这里显示的值是: {{num}}</p>

    <button @click="subOneNum">减 1</button>
    <button @click="subNNum(8)">减 n</button>
    <button @click="subOneNumAsync">减 1 async</button>
    <button @click="subNNumAsync(3)">减 n async</button>
  </div>
</template>
<script>
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex'

export default {
  data() {
    return {
      
    }
  },
  computed: {
    ...mapState(['num']),
    ...mapGetters(['infoNum'])
  },
  methods: {
    ...mapMutations(['subOneNum', 'subNNum']),
    ...mapActions(['subOneNumAsync', 'subNNumAsync'])
  }
}
</script>
<style lang="css" scoped>
  
</style>